/**
* 作者: clz
* 日期: 2025-06-05 20:12:10
* 备注: 联盟聊天记录表
*/
package com.motu.monstercity.server.game.userdata;

import com.motu.monstercity.protocol.Common;
import com.motu.monstercity.server.game.logic.ChatManager;
import com.motu.vertx.module.utility.toolset.TimeUtils;

public class ChatUnion extends ChatUnionModel {
	public ChatUnion() {
		super();
	}

	/**
	 * 构建联盟聊天对象
	 * @param userInfo
	 * @param subType
	 * @param unionId
	 * @param msg
	 * @param param
	 */
	public ChatUnion(UserInfo userInfo, int subType, long unionId, String msg, String param) {
		putSubType(subType);
		putUnionId(unionId);
		if(userInfo != null) {
			putUserId(userInfo.getId());
		}
		putContent(msg);
		putAddTime(TimeUtils.getCurTime());
		putParam(param);
	}

	/**下发聊天结构
	 * @return
	 */
	public Common.PBChatMsg.Builder takeBuilder(){
		return ChatManager.takeChatMsgBuilder(getUserId(),getId(),ChatManager.CHAT_TYPE_UNION,getSubType(),getContent(),getAddTime(),getParam());
	}
}
